package com.lagou.task10;


public class StaticOuter {
    private int cnt = 1;
    private static int snt = 2;

    public void show(){
        System.out.println("外部类的show = ");//2
//            System.out.println("外部类的cnt = " + cnt);静态上下文中不能访非静态成员
    }

    public static class StaticInner{
        private int ia = 3;
        private static int snt = 4;

        StaticInner(){
            System.out.println("静态内部类的构造方法");
        }
        public void show(){
            System.out.println("ia = " + ia);//3
            System.out.println("外部类的snt = " + snt);//2
//            System.out.println("外部类的cnt = " + cnt);静态上下文中不能访非静态成员
        }
        public void show2(int snt){
            System.out.println("snt = " + snt);//3
            System.out.println("内部类的snt = " + StaticInner.snt);//2
            System.out.println("外部类的snt = " + StaticOuter.snt);
//            StaticOuter.show();
            new StaticOuter().show();
//            System.out.println("外部类的cnt = " + cnt);静态上下文中不能访非静态成员
        }

    }
}